<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
       
    </h:head>
    <f:view>
               <h:form id="UserForm" prependId="false" >
                   <p:growl id="growl" showDetail="true" life="3000" /> 
                         <p:panel header="Thêm Mới Môn Học" style="background-color: #ebf3fd;">  
                            <h:panelGrid columns="2" cellpadding="5">  
                                         <h:outputLabel for="username" value=" Mã Lớp : *" />  
                                         <p:inputText value="#{lopbean.mahp}"   id="username" required="true" label="username" />  
                                         <h:outputLabel for="tenmh" value="Tên Lớp : * " />  
                                         <p:inputText value="#{lopbean.tenhp}"   id="tenmh" required="true" label="Tên Môn Học" />  
                                          <h:outputLabel  value=" Giáo Viên:  " />  
                                         <h:selectOneMenu id = "managerListBox" value ="#{lopbean.magv}"  onchange="submit()"   >
                                             <f:selectItems value = "#{lopController.getAllGiaoVien()}" itemLabel ="#{lopController.getAllGiaoVien()}"  />
                                         </h:selectOneMenu>
                                           <h:outputLabel  value=" Môn Học :  " />  
                                         <h:selectOneMenu id = "listMonHoc" value ="#{lopbean.mamh}"  >
                                              <f:valueChangeListener type="controller.LopController" />
                                             <f:selectItems value = "#{lopController.getAllMonHoc()}"  />
                                         </h:selectOneMenu>
                                           <h:outputLabel  value=" Học Kỳ :  " />  
                                         <h:selectOneMenu id = "listHocKy" value ="#{lopbean.mahk}"   >
                                             <f:selectItems value = "#{lopController.getAllHocKy()}" itemDescription="#{lopController.getAllHocKy()}"  />
                                         </h:selectOneMenu>
                                          
                                         <f:facet name="footer">  
                                         <p:commandButton value=" Thêm Mới " update="formTable,UserForm"    action="#{lopController.actionAdd(lopbean)}" ajax="true"  />               
                                     </f:facet>  
                           </h:panelGrid> 
                       </p:panel> 
               </h:form>
    </f:view>
</html>

